package com.car.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.car.entity.MaintenanceRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 保养记录Mapper接口
 *
 * @author Car System
 */
@Mapper
public interface MaintenanceRecordMapper extends BaseMapper<MaintenanceRecord> {

    /**
     * 分页查询保养记录（带车辆和客户信息）
     */
    IPage<MaintenanceRecord> selectRecordPageWithDetails(
            Page<MaintenanceRecord> page,
            @Param("keyword") String keyword,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime
    );

    /**
     * 查询月度保养统计
     */
    List<Map<String, Object>> selectMonthlyStatistics(@Param("months") Integer months);
}

